function CurrentChange(chaine){
    
        ChangePage(chaine);
	
        if (chaine != "login"||chaine != "register"){
            var myTextField = document.getElementById(chaine);
        }
        
        var OngletAccueil = document.getElementById("OngletAccueil");
        var OngletBonPlan = document.getElementById("OngletBonPlan");
        var OngletPapeterie = document.getElementById("OngletPapeterie");
        var OngletSupportSpeciaux = document.getElementById("OngletSupportSpeciaux");
        var OngletRevente = document.getElementById("OngletRevente");
        var OngletInfo = document.getElementById("OngletInfo");
        var SubOngletPapeterie = document.getElementById("SubOngletPapeterie");
        var SubOngletEvenement = document.getElementById("SubOngletEvenement");
        var SubOngletImpressionClassique = document.getElementById("SubOngletImpressionClassique");
        
        OngletAccueil.className = "";
        OngletBonPlan.className = "";
        OngletPapeterie.className = "";
        OngletSupportSpeciaux.className = "";
        OngletRevente.className = "";
        OngletInfo.className = "";
        
        if (chaine == "SubOngletPapeterie" || chaine == "SubOngletEvenement" || chaine == "SubOngletImpressionClassique" )
        {
             OngletPapeterie.className = "current";
        }
        
        SubOngletPapeterie.className = "";
        SubOngletEvenement.className = "";
        SubOngletImpressionClassique.className = "";

        if (chaine != "login"||chaine != "register"){
        	myTextField.className = "current";
        }

}

function ChangePage(chaine)
{ 
    var req = false;
    try {
        req = new ActiveXObject('Msxml2.XMLHTTP');
        }
    catch (err2) {
        try {
             req = new ActiveXObject('Microsoft.XMLHTTP');
            }
        catch (err3) {
            try {
		req = new XMLHttpRequest();
		}
            catch (err1) {
		req = false;
		}
            }
        }
    req.onreadystatechange = function()
    { 
	document.getElementById("in").innerHTML="Wait server...";
	if(req.readyState == 4)
	{
            if(req.status == 200)
            {
                document.getElementById("in").innerHTML = req.responseText;
            }	
            else	
            {
		document.getElementById("in").innerHTML = "Error: returned status code " + req.status + " " + req.statusText;
            }	
	} 
    }; 
    req.open("GET", chaine+".jsf", true); 
    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
    req.send(null); 
} 
